Skip to content

Conversation

@dgrove-oss
Copy link
Contributor

Add extensions to Bridgeable types to define
their conformance to the ObjectiveCBridgeable
protocol in terms of the existing bridging
support. Since the compiler understands the
semantics of ObjectiveCBridgeable this allows
'as' conversions to be performed to/from various
NS types on platforms without ObjectiveC.

@dgrove-oss
Copy link
Contributor Author

Relies on swift pull request swiftlang/swift#1994 which makes the protocol available.

@parkera
Copy link
Contributor

parkera commented Apr 1, 2016

Thanks Dave. Let's hold on to this and make sure the other PR goes through.

@phausler
Copy link
Contributor

phausler commented Apr 4, 2016

I guess the other followup part is to test via removing the calls to .bridge() and replace them with as conversions. If that works then we should see if the implicit conversions will work too (giving us source compatibility with struct <-> object conversion)

@dgrove-oss
Copy link
Contributor Author

Agreed. I can start going through the tests. I can structure either as a separate pull request or as an addendum to this one. Either is fine with me.

@phausler
Copy link
Contributor

phausler commented Apr 4, 2016

I think it may be best to have them separate just in case we get compiler crashes from the as conversion

@dgrove-oss
Copy link
Contributor Author

Test suite update in #310

Add extensions to Bridgeable types to define
their conformance to the _ObjectiveCBridgeable
protocol in terms of the existing bridging
support.  Since the compiler understands the
semantics of _ObjectiveCBridgeable this allows
'as' conversions to be performed to/from various
NS types on platforms without ObjectiveC.
@dgrove-oss
Copy link
Contributor Author

rebased to master as of 4/25; updated for Swift change for first argument labels; squashed to single commit.

@parkera
Copy link
Contributor

parkera commented May 28, 2016

I'm going to follow up on this with some swift compiler engineers and get back to you on it. The recent back and forth with implicit bridging going away has confused things...

@dgrove-oss
Copy link
Contributor Author

ok, thanks Tony. I'm happy with any outcome. If we need this, I will rebase it. If we don't need it after all, no problem...I learned a few things doing it.

@dgrove-oss
Copy link
Contributor Author

not needed; closing.

@dgrove-oss dgrove-oss closed this Aug 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants